package scala.mytrait

/**
 * 叠加
 */
trait PersonSuperpositionTrait {

}

trait Ball{
  def describe(): String = "ball"
}

trait Color extends Ball{
  var color:String ="黄色"

  override def describe(): String =  color + "-" + super.describe()
}

trait Category extends Ball{
  var category: String = "foot"

  override def describe(): String = category + "-" + super.describe()
}

class MyCall extends Category with Color{
  override def describe(): String = "MyCall is a "+super.describe()
}

object mainTest{
  def main(args: Array[String]): Unit = {
    val myCall = new MyCall();
    println(myCall.describe())
  }
}